<template>
  <div>
    <el-table :data="list">
      <el-table-column type="index" label="序号"/>
      <el-table-column label="操作类型" prop="change"/>
      <el-table-column label="操作人" prop="dealer"/>
      <el-table-column label="商品ID" prop="goods_id"/>
      <el-table-column label="商品名" prop="goods_name"/>
      <el-table-column label="商品库存" prop="num"/>
      <el-table-column label="采购价" prop="price"/>
      <el-table-column label="供应商" prop="provider"/>
      <el-table-column label="操作时间" prop="created"/>
    </el-table>
    <div style="text-align: right; margin-top: 10px;">
      <el-pagination
        small
        class="page"
        @current-change="load"
        :current-page.sync="pageNumber"
        :page-size="20"
        layout="prev, pager, next, jumper"
        :total="total || 0"
      ></el-pagination>
    </div>
  </div>
</template>

<script>
    export default {
        name: "stockLog",
      data(){
          return {
            list: [],
            total: 0,
            pageNumber: 1
          }
      },
      methods:{
          load(){
            this.$http({
              url: this.$http.adornUrl('/sys/storage/logPage'),
              method: 'get',
              params: this.$http.adornParams(
                {
                  page: this.pageNumber
                }
              )
            }).then(({data}) => {
              this.list = data.list
              this.total = Number(data.total)
            })
          }
      },
      mounted() {
          this.load()
      }
    }
</script>

<style scoped>

</style>
